package com.csj.DesignPattern.derorator;

//同BufferedWriter
public abstract class Garnish extends FastFood {
    //！！！！！！又继承FastFood，又聚合FastFood
    private FastFood fastFood;

    public Garnish(float price, String description, FastFood fastFood) {
        //装饰的部分
        super(price, description);
        //保留原来的FastFood
        this.fastFood = fastFood;
    }

    public FastFood getFastFood() {
        return fastFood;
    }

    public void setFastFood(FastFood fastFood) {
        this.fastFood = fastFood;
    }
}
/*
public class BufferedWriter extends Writer {
    private Writer out;

    public BufferedWriter(Writer out, int sz) {
        super(out);
        //保留原来的Writer
        this.out = out;
        //装饰的部分
        cb = new char[sz];
        nChars = sz;
    }
}
 */
